<?php

set_time_limit(0);

require_once "API.php";

global $database;

$items = $database->select("pattern", "*");

$ids = [];

foreach ($items as $item) {
    $ids[] = $item['pid'];
}

$str = implode(",", $ids);

$api = new API();
$api->addIndex($str);
echo 'done';
